'''
Created on 2009-7-28

@author: crackcell
'''

import urllib2

def post(url, data, is_debug):
    if is_debug:
        print "** post **"
    req = urllib2.Request(url, data)
    try:
        respon = urllib2.urlopen(req)
        result = respon.read()
    except Exception, e:
        if is_debug:
            print "** exception from crackcell.http.post:"
            print type(e)
        return False
    return result

def get(url, is_debug):
    if is_debug:
        print "** get **"
    req = urllib2.Request(url)
    try:
        respon = urllib2.urlopen(req)
        result = respon.read()
    except Exception, e:
        if is_debug:
            print "** exception from crackcell.http.get:"
            print type(e)
        return False
    return result
    
    
